﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Xml.Serialization;

[XmlRoot()]
public class Couche
{
    [XmlElement()]
    public List<Perceptron> liste;

    public Couche()
    {
    }

    public Couche(int size, int previous_size, double alpha)
    {
        liste = new List<Perceptron>();

        for (int i = 0; i <= size - 1; i++)
        {
            liste.Add(new Perceptron(previous_size - 1, alpha));
        }
    }

    public Perceptron getPerceptron(int indiceNeurone)
    {
        return liste[indiceNeurone];
    }

    public void calculPotentielCouche()
    {
        foreach (Perceptron p in liste)
        {
            p.calculPotentiel(0);
            p.getSortie = (Perceptron.activation(p.getPotentiel, 1));
        }
    }

    public int size()
    {
        return liste.Count;
    }
}